/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package donnees;

import java.util.HashMap;

/**
 *
 * @author emeline
 */
public class User {

    private int id;
    private String login;
    private String password;
    private HashMap<String, String> hash;

    public User(String login, String password) {
        this.login = login;
        this.password = password;
    }

    public boolean validate() {
        if (login == null || password == null) {
            return false;
        }
        UserDAO user = new UserDAO();
        //TODO faire la validation avec derby
        return user.validateUser(login, password);
        //return true;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLogin() {
        return login;
    }

    public String getUsername() {
        return login;
    }

    public String getPassword() {
        return password;
    }

    public HashMap<String, String> getHash() {
        return hash;
    }

    /**
     * @param hash the hash to set
     */
    public void setHash(HashMap<String, String> hash) {
        this.hash = hash;
    }

}
